import React,{useState,useEffect} from "react";

function TimerHook(){
    
    const [count,setCount]= useState(0);
    useEffect(() =>{
        const timer = setTimeout(() =>{
            setCount(count+1);
        },1000)
        return ()=>{
            clearInterval(timer)
        }
    },[count])
    return (
        <div >TimerHook{count}</div>
    )
}
export default TimerHook;